/* 
 *	Copyright (C) 2009-2010 miaohua
 *	http://code.google.com/p/lrcshower/
 *
 *  This Program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *   
 *  This Program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with GNU Make; see the file COPYING.  If not, write to
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */

#pragma once
#include "TypeDef.h"


///Lrc show filter window show mode properties setting class
class CLrcShowFilterWinProperties : public CBasePropertyPage
{
public:

    static CUnknown * WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT *phr);
    DECLARE_IUNKNOWN;

private:

    BOOL OnReceiveMessage(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);

    HRESULT OnConnect(IUnknown *pUnknown);
    HRESULT OnDisconnect();
    HRESULT OnActivate();
    HRESULT OnApplyChanges();

    void SetDirty();

	///Set properties functions
    void SetLrcFile(HWND hwnd);
    void SetFont();
    void SetColor(HWND hwnd);
    void SetAlignment();
    void SetKaraokeMode();
	void SetGradientMode();
	void SetAutoResizeMode();
    void SetTopMostMode();
	void SetDefaultVal(HWND hwnd);

    ///Initialization functions
    void InitializeCtrls(HWND hwnd);
	void InitializeComboBox(HWND wnd, HWND & handler, UINT CtlID, TCHAR ** Items, int size, int OptIdx=0);
	///The call back founctions	
	void StartCaptureWin(HWND hwnd);
    static void CALLBACK TimeOutProc(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2);
	void TimeOutWorkFunc();
    ///Helper functions
	void ShowWndProperty(HWND hwnd);


    CLrcShowFilterWinProperties(LPUNKNOWN lpunk, HRESULT *phr);

    ILrcShowFilter*  m_ILrcShowFilter;    // Lrc Show Filter property interface
    HWND m_AlignSelCombox;                // The handler of alignment combobox control
    HWND m_KaraokeChkbox;                 // The handler of Karaoke show mode check box control
	HWND m_GradientChkbox;                // The handler of Gradient show mode check box control
	HWND m_AutoResizeChkbox;              // The handler of Auto resize show mode check box control
    HWND m_TopMostChkbox;                 // The handler of topmost mode check box control
	HWND m_CrossLocation;                 // The cross target picture location
	HWND m_ClrTypeCombox;                 // The handler of color type selection combobox control 
	HWND m_WinHdlValTex;                  // The handler of text box for show&edit lrc show window's handler value
	HWND m_WinSizeValTex;                 // The handler of text box for show the lrc show window size value
	MMRESULT m_ClkTimer;                  // The handler of timer
	UINT m_CrossTargetBmpId;              // Resource id for cross target bmp
};

